package com.jdyfy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jdyfy.entity.Announcement;
import com.jdyfy.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AnnouncementMapper extends BaseMapper<Announcement> {

    // 批量查询公告
    List<Announcement> getAnnouncementsByProjectNumbers(@Param("projectNumbers") List<String> projectNumbers);

    // 根据公告名称查询公告
    @Select("select * from announcements where announcement_name like concat('%',#{announcementName},'%') ")
    Announcement getByAnnouncementName(String announcementName);

    @Delete("DELETE from announcements where announcement_name like concat('%',#{projectName},'%')")
    void deleteByName(String projectName);
}
